]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
endSessionDialog: Differentiate between prepared and scheduled updates again
authorMilan Crha <mcrha@redhat.com>
Tue, 21 Apr 2026 15:38:10 +0000 (17:38 +0200)
committerMilan Crha <mcrha@redhat.com>
Wed, 22 Apr 2026 13:49:50 +0000 (15:49 +0200)
The prepared updates are those downloaded, while the scheduled updates
are those ready to be installed the next machine boot. The previous
gnome-software change with its OfflineUpdates D-Bus interface did not
count with it and claimed all the updates as scheduled, even when they
had been only prepared. This makes it work again by utilizing the
gnome-software changes.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4185>

data/dbus-interfaces/org.gnome.Software.OfflineUpdates.xml
js/ui/endSessionDialog.js

index 82356bc70d7c187c3f1717898e98e841565445fb..15a20fc70a645c81c8698a9bdfd52e3df96744ec 100644 (file)
@@ -14,8 +14,9 @@
     <!--
     string GetState(void):
     Gets state of any offline updates. The returned values can be:
-    "none" - no offline update is scheduled
-    "scheduled" - an offline update is scheduled
+    "none" - no offline update is prepared nor scheduled
+    "prepared" - an offline update is prepared and can be scheduled by SetAction() method
+    "scheduled" - an offline update is scheduled for the next reboot
     -->
     <method name="GetState">
       <arg type="s" name="state" direction="out" />
index 7b666f090a441a1275687484f1a69c24c6aa4ce8..84da305582d213931e4c68e6023a866a8a768147 100644 (file)
@@ -668,11 +668,13 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
 
         try {
             const state = await this._getUpdateState();
+            this._updatePrepared = state === 'prepared';
             this._updateScheduled = state === 'scheduled';
         } catch (e) {
             if (this._softwareOfflineUpdatesProxy !== null)
                 log(`Failed to get update info from gnome-software: ${e.message}`);
 
+            this._updatePrepared = false;
             this._updateScheduled = false;
         }
 
@@ -709,7 +711,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
             this._loadSessions().catch(logError);
 
         _setCheckBoxLabel(this._checkBox, dialogContent.checkBoxText || '');
-        this._checkBox.visible = dialogContent.checkBoxText && this._updateScheduled;
+        this._checkBox.visible = dialogContent.checkBoxText && this._updatePrepared;
 
         this._checkBox.checked = this._checkBox.visible && !this._isBatteryLow();